﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ZengZiLSSB.aspx.cs" Inherits="Web.Pages.YongShui.YongHuGL.ZengZiLSSB" Theme="Default" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../../../../JS/AddEditCancel.js"></script>
    <style type="text/css">
        .left {
            text-align: left;
        }

        .center {
            text-align: center;
        }

        .right {
            text-align: right;
        }

        table {
            width: 100%;
        }
    </style>
    <script type="text/javascript">
        function keyEnter(index) {
            var controls = new Array();
            controls[0] = document.getElementById("txtMINGCHENG_I");
            controls[1] = document.getElementById("ddlGUANLIK_I");
            controls[2] = document.getElementById("ddlSUOSHUSF_I");
            controls[3] = document.getElementById("txtWENJIANMMGZ_I");
            var key = event.keyCode;
            if (key == 13) {
                index = index + 1;
                if (index == controls.length) {
                    index = 0;
                }
                controls[index].focus();
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>


        <div class="tabletitle1" align="center">
            增自来水水表
        </div>
        <asp:UpdatePanel ID="updatePanel1" runat="server">
            <ContentTemplate>
                <div>
                    <fieldset style="border: 1px solid  cornflowerblue">
                        <legend style="font-weight: bold">用户资料</legend>
                        <table style="margin: auto; line-height: 22px">
                            <tr>
                                <td width="100px" class="right">用户号：</td>
                                <td>
                                    <table>
                                        <tr>
                                            <td style="width: 197px">
                                                <dx:ASPxTextBox ID="txtYongHuH" runat="server" Width="100px">
                                                    <ClientSideEvents KeyPress="function(s,e){var key = event.keyCode;
                                        if( key==13){btnSearch.onClick();}}" />
                                                </dx:ASPxTextBox>
                                            </td>
                                            <td>
                                                <dx:ASPxButton ID="btnSearch" ClientInstanceName="btnSearch" runat="server" Text="查找" OnClick="btnSearch_Click" UseSubmitBehavior="false"></dx:ASPxButton>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="right">用户名：</td>
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <dx:ASPxTextBox ID="txtYongHuM" runat="server" Width="494px" Enabled="false"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                    </table>                                    
                                </td>                                    
                                </td>
                            </tr>
                            <tr>
                                <td class="right">用户地址：</td>
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <dx:ASPxTextBox ID="txtDiZhi" runat="server" Width="494px" Enabled="false"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                    </table>                                      
                                </td>
                            </tr>
                        </table>
                        <dx:ASPxGridView ID="gvList1" runat="server" AutoGenerateColumns="False" KeyFieldName="ID" Theme="Aqua1" Width="98%">
                            <Columns>
                                <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOBH" Caption="水表号" Width="20%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="S_DIZHI" Caption="水表地址" Width="40%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="S_MINGCHENG" Caption="水表户名" Width="40%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Width="35px">
                                <DataItemTemplate>
                                    <asp:LinkButton ID="lnbDel" runat="server" CausesValidation="false" Text="删除"  CommandArgument='<%#Eval("S_SHUIBIAOBH")%>' OnCommand="lnbDel_Command1" >
                                    </asp:LinkButton>
                                </DataItemTemplate>
                            </dx:GridViewDataTextColumn>
                            </Columns>
                            <Settings VerticalScrollableHeight="130" VerticalScrollBarMode="Auto" />
                        </dx:ASPxGridView>
                    </fieldset>
                </div>
                <div style="height: 2px;"></div>
                <fieldset style="border: 1px solid  cornflowerblue">
                    <legend style="font-weight: bold">增表操作</legend>
                    <table>
                        <tr>
                            <td style="text-align: right; width: 100px;">水表号：</td>
                            <td style="width: 197px">
                                <dx:ASPxTextBox ID="txtConShuiBiaoH" runat="server" Width="197px">
                                    <ClientSideEvents KeyPress="function(s,e){var key = event.keyCode;
                                        if( key==13){$('#btnSearch2').click();}}" />
                                </dx:ASPxTextBox>
                            </td>
                            <td>
                                <dx:ASPxButton ID="btnSearch2" runat="server" Text="查找" UseSubmitBehavior="false" OnClick="btnSearch2_Click"></dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    <dx:ASPxGridView ID="gvList2" runat="server" AutoGenerateColumns="False" KeyFieldName="S_SHUIBIAOBH" Theme="Aqua1" Width="98%"
                        EnableCallBacks="false">
                        <Columns>
                            <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOBH" Caption="水表号" Width="20%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_SHUIBIAODZ" Caption="水表地址" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOHM" Caption="水表户名" Width="40%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Width="35px">
                                <DataItemTemplate>
                                    <asp:LinkButton ID="lnbDel" runat="server" CausesValidation="false" Text="删除"  CommandArgument='<%#Eval("S_SHUIBIAOBH")%>' OnCommand="lnbDel_Command" >
                                    </asp:LinkButton>
                                </DataItemTemplate>
                            </dx:GridViewDataTextColumn>
                        </Columns>
                        <SettingsBehavior AllowFocusedRow="True" ColumnResizeMode="Control"  ProcessFocusedRowChangedOnServer="True" />
                        <Settings VerticalScrollableHeight="120" VerticalScrollBarMode="Auto" />
                    </dx:ASPxGridView>
                </fieldset>
                <hr />
                <div>
                    <asp:Label ID="lblErr" runat="server" Font-Bold="True" Font-Size="14pt" ForeColor="Red"></asp:Label>
                </div>
                <div style="text-align: right;">
                    <dx:ASPxButton ID="btnAdd" runat="server" Text="增表" OnClick="btnAdd_Click" UseSubmitBehavior="false"></dx:ASPxButton>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>


